/*
 * @Description: 路由配置
 * @Author:  zhangweigang
 * @Date: 2021-02-14 20:08:04
 * @LastEditTime: 2021-04-22 19:45:50
 * @LastEditors: zhangweigang
 */
import Vue from 'vue';
import VueRouter from 'vue-router';
// 懒加载方式导入路由组件
const Mian = () => import('@/views/main/Main.vue');
const Home = () => import('@/views/home/Home.vue');
const MyUpload = () => import('@/views/pages/MyUpload.vue');
const UploadList = () => import('@/views/pages/UploadList.vue');
const ShareBook = () => import('@/views/pages/ShareBook.vue');
const LeaveMessage = () => import('@/views/pages/LeaveMessage.vue');
const Announce = () => import('@/views/pages/Announce.vue');
const FeedBack = () => import('@/views/pages/FeedBack.vue');
const FeedList = () => import('@/views/pages/feedList.vue');
const PersonInfo = () => import('@/views/pages/PersonInfo.vue');
const ModifyPassWord = () => import('@/views/pages/ModifyPassWord.vue');
const OunceDetail = () => import('@/views/pages/OunceDetail.vue');
Vue.use(VueRouter);

// 配置路由路径
const routes = [
  {
    path: '/',
    redirect: '/main'
  },
  {
    path: '/main',
    name: 'Mian',
    component: Mian
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/myupload',
    name: 'MyUpload',
    component: MyUpload
  },
  {
    path: '/uploadlist',
    name: 'UploadList',
    component: UploadList
  },
  {
    path: '/sharebook',
    name: 'ShareBook',
    component: ShareBook
  },
  {
    path: '/leavemessage',
    name: 'LeaveMessage',
    component: LeaveMessage
  },
  {
    path: '/announce',
    name: 'Announce',
    component: Announce
  },
  {
    path: '/detail/:id',
    component: OunceDetail
  },
  {
    path: '/feedback',
    name: 'FeedBack',
    component: FeedBack
  },
  {
    path: '/feedlist/:id',
    name: 'FeedList',
    component: FeedList
  },
  {
    path: '/personinfo',
    name: 'PersonInfo',
    component: PersonInfo
  },
  {
    path: '/modifypassword',
    name: 'ModifyPassWord',
    component: ModifyPassWord
  }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});
// 导出配置
export default router;
